<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link type="text/css" rel="stylesheet" href="http://127.0.0.1:8081/css/style.css" />
    <!--[if IE 6]>
    <script src="http://127.0.0.1:8081/js/iepng.js" type="text/javascript"></script>
    <script type="text/javascript">
        EvPNG.fix('div, ul, img, li, input, a');
    </script>
    <![endif]-->
    <script type="text/javascript" src="http://127.0.0.1:8081/js/jquery-1.11.1.min_044d0927.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/jquery.bxslider_e88acd1b.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/menu.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/select.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/lrscroll.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/iban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/fban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/f_ban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/mban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/bban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/hban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/tban.js"></script>
    <script type="text/javascript" src="http://127.0.0.1:8081/js/lrscroll_1.js"></script>
    <script type="text/javascript">
        function validate() {
            var pw1 = document.getElementById("pw1").value;
            var pw2 = document.getElementById("pw2").value;
            if(pw1 == pw2) {
                document.getElementById("tishi").innerHTML="<font color='green'>两次密码相同</font>";
                document.getElementById("submit").disabled = true;
            }
            else {
                document.getElementById("tishi").innerHTML="<font color='red'>两次密码不相同</font>";
                document.getElementById("submit").disabled = false;
            }
        }
    </script>

    <title>易买网注册页面</title>
</head>
<body>
<!--Begin Header Begin-->
<div class="soubg">
    <div class="sou">
        <span class="fr">
        	<span class="fl">你好，请<a href="gologin">登录</a>&nbsp; <a href="goRegist" style="color:#ff4e00;">免费注册</a>&nbsp; </span>
        </span>
    </div>
</div>
<!--End Header End-->
<!--Begin Login Begin-->
<div class="log_bg">
    <div class="top">
        <div class="logo"><a href="Index.html"><img src="http://127.0.0.1:8070/logo.png" /></a></div>
    </div>
    <div class="regist">
        <div class="log_img"><img src="http://127.0.0.1:8070/l_img.png" width="611" height="425" /></div>
        <div class="reg_c">
            <form action="adduser" method="post" onsubmit="return yanzh2()">
                <table border="0" style="width:420px; font-size:14px; margin-top:20px;" cellspacing="0" cellpadding="0">
                    <tr height="50" valign="top">
                        <td width="95">&nbsp;</td>
                        <td>
                            <span class="fl" style="font-size:24px;">注册</span>
                            <span class="fr">已有商城账号，<a href="gologin" style="color:#ff4e00;">我要登录</a></span>
                        </td>
                    </tr>
                    <tr height="50">
                        <td align="right"><font color="#ff4e00">*</font>登录用户名 &nbsp;</td>
                        <td><input type="text"  name="loginName" id="loginName" class="l_user" onblur="findUser()" required/></td>
                    </tr>
                    <tr height="50">
                        <td align="right"><font color="#ff4e00">*</font>&nbsp;密码 &nbsp;</td>
                        <td><input type="password" id="pw1" value="" name="password" class="l_pwd" minlength="3" required/></td>
                    </tr>
                    <tr height="50">
                        <td align="right"><font color="#ff4e00">*</font>&nbsp;确认密码 &nbsp;</td>
                        <td><input type="password" id="pw2" value="" name="confirmPassword" class="l_pwd" onkeyup="return validate()" required/><span id="tishi"></span></td>
                    </tr>
                    <tr height="50">
                        <td align="right"><font color="#ff4e00">*</font>&nbsp;真实姓名 &nbsp;</td>
                        <td><input type="text" value="" name="userName" class="l_user" required/></td>
                    </tr>
                    <tr height="50">
                        <td align="right"><font color="#ff4e00">*</font>&nbsp;性别 &nbsp;</td>
                        <td>
                            <input type="radio" name="sex" value="1" checked="checked">&nbsp;男&nbsp;&nbsp;
                            <input type="radio" name="sex" value="0">&nbsp;女
                        </td>
                    </tr>
                    <tr height="50">
                        <td align="right">&nbsp;身份证号 &nbsp;</td>
                        <td><input type="text" value="" name="identityCode" class="l_user"maxlength="18" /></td>
                    </tr>
                    <tr height="50">
                        <td align="right">&nbsp;邮箱 &nbsp;</td>
                        <td><input type="text" value="" name="email" class="l_email" /></td>
                    </tr>
                    <tr height="50">
                        <td align="right">&nbsp;手机 &nbsp;</td>
                        <td><input type="text" value="" name="mobile" class="l_tel" maxlength="11" /></td>
                    </tr>
                    <tr height="50">
                        <td align="right">&nbsp;验证码 &nbsp;</td>
                        <td><input type="text" name="codeImage" id="codeImage" value="" class="l_pwd" required/><img th:src="'http://127.0.0.1:8070/'+${codeImage}+'.jpg'">
                            <input type="hidden" id="codeImage2" th:value="${codeImage}"/><a href="gologin">&nbsp;换一张</a>
                        </td>
                    </tr>
                    <tr><td>&nbsp;</td>
                        <td style="font-size:12px; padding-top:20px;">
                        <span style="font-family:'宋体';" class="fl">
                    	<label class="r_rad"><input type="checkbox" id="ckeckk"/></label>
                        <label class="r_txt">我已阅读并接受《用户协议》</label>
                        </span>
                        </td>
                    </tr>
                    <tr height="60">
                        <td>&nbsp;</td>
                        <td><input type="submit" value="立即注册" class="log_btn" /></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<!--End Login End-->
<!--Begin Footer Begin-->
<div class="btmbg">
    <div class="btm">
        备案/许可证编号：蜀ICP备12009302号-1-www.dingguagua.com   Copyright © 2015-2018 尤洪商城网 All Rights Reserved. 复制必究 , Technical Support: Dgg Group <br />
        <img src="http://127.0.0.1:8070/b_1.gif" width="98" height="33" />
        <img src="http://127.0.0.1:8070/b_2.gif" width="98" height="33" />
        <img src="http://127.0.0.1:8070/b_3.gif" width="98" height="33" />
        <img src="http://127.0.0.1:8070/b_4.gif" width="98" height="33" />
        <img src="http://127.0.0.1:8070/b_5.gif" width="98" height="33" />
        <img src="http://127.0.0.1:8070/b_6.gif" width="98" height="33" />
    </div>
</div>
<!--End Footer End -->
</body>
<!--[if IE 6]>
<script src="127.0.0.1:8081/js/zh_CN.js"></script>
<![endif]-->
<script type="text/javascript" th:inline="javascript">

    function yanzh2() {
        var name=$("#loginName").val();
        var codeImage=jQuery("#codeImage").val();
        var codeImage2=jQuery("#codeImage2").val();
        //var password=$("#pw1").val();
        // $.ajaxSetup({   //设置为同步
        //     async : false
        // });
        if (codeImage.toLowerCase()==codeImage2.toLowerCase()) {
            var check = jQuery('#ckeckk');
            if(check.is(":checked")){
                return true;
            }else {
                alert("请勾选用户协议")
                return false;
            }
        }else{
            alert("验证码输入错误，请重新输入！");
            return false;
            //fla=true;
        }


    }

    function findUser() {
        var name=jQuery("#loginName").val();
        var tag = false;
        if (name==""||name==null) {
            tag=false;
        }else{
            jQuery.post("reg",{"loginName":name},
                function (result) {
                    if (!result) {
                        alert("用户名已存在");
                        tag=false;
                    }
                },"json");
        }
    }
</script>

</html>
